#include "admin_0.h"
#include "ui_admin_0.h"
#include "ad_custom.h"
#include "ad_sechname.h"
#include "mainwindow.h"
#include "cangku.h"
#include "ad_sell.h"
#include "ad_caiwu.h"
#include "dialoglogin.h"
#include "value.h"
#include <QDebug>
#include <QTimer>
#include <QDate>
#include <QDateTime>

Admin_0::Admin_0(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Admin_0)
{
    ui->setupUi(this);
    setWindowTitle("管理员系统");
    _name="admin123";
    QTimer *timer=new QTimer(this);
    connect(timer,SIGNAL(timeout()),this,SLOT(TimeUpdate_ad()));
    timer->start(1000); // 每次触发timeout信号时间间隔为1秒
}

Admin_0::~Admin_0()
{
    delete ui;
}

void Admin_0::TimeUpdate_ad()
{
    QDateTime atime=QDateTime::currentDateTime();
    QString tt=atime.toString("yyyy年MM月dd日 hh:mm:ss");
    ui->time->setText(tt);
}


void Admin_0::on_action_3_triggered() //会员信息
{
    this->close();
    ad_custom *adc = new ad_custom(this);//新建子界面
    adc->show();//子界面出现
}

void Admin_0::on_action_5_triggered()//退出系统
{
    close();
}

void Admin_0::on_action_triggered() //进货系统
{
    this->close();
    CangKu *ck=new CangKu(this);
    ck->show();
}

void Admin_0::on_action_2_triggered() //统计系统
{
    this->close();
    MainWindow *mw=new MainWindow(this);
    mw->show();
}

void Admin_0::on_action_6_triggered()//售货系统
{
    this->close();
    ad_sell *sh=new ad_sell(this);
    sh->show();
}

void Admin_0::on_action_4_triggered()//财务流水
{
    this->close();
    ad_CaiWu *cw=new ad_CaiWu(this);
    cw->show();
}
